<template>
	<view>
		<view class="status" :style="{ opacity: afterHeaderOpacity }"></view>
		<view class="header">
			<!-- 头部-默认显示 -->
			<view class="before" :style="{ opacity: 1 - afterHeaderOpacity, zIndex: beforeHeaderzIndex }">
				<view class="back">
					<view class="yticon icon-zuo" @tap="back" v-if="showBack"></view>
				</view>
				<view class="middle"></view>
				<view class="icon-btn">
					<view class="yticon icon-icon--" @tap="toMsg"></view>
					<view class="yticon icon-share" @tap="share"></view>
				</view>
			</view>
			<!-- 头部-滚动渐变显示 -->
			<view class="after" :style="{ opacity: afterHeaderOpacity, zIndex: afterHeaderzIndex }">
				<view class="back">
					<view class="yticon icon-zuo" @tap="back" v-if="showBack"></view>
				</view>
				<view class="middle">
					<view v-for="(anchor,index) in anchorlist" class="middle_item" :class="[selectAnchor==index ?'on':'']" :key="index" @tap="toAnchor(index)">{{anchor.name}}</view>
				</view>
				<view class="icon-btn">
					<view class="yticon icon-icon--" @tap="toMsg"></view>
					<view class="yticon icon-share" @tap="share"></view>
				</view>
			</view>
		</view>
		<!-- 服务-模态层弹窗 -->
		<view class="popup service" :class="serviceClass" @touchmove.stop.prevent="discard" @tap="hideService">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer" @tap.stop="discard">
				<view class="content">
					<view class="row" v-for="(item,index) in goodsData.service" :key="index">
						<view class="title">{{item.name}}</view>
						<view class="description">{{item.description}}</view>
					</view>
				</view>
				<view class="btn">
					<view class="button" @tap="hideService">完成</view>
				</view>
			</view>
		</view>
		<!-- 商品主图轮播 -->
		<view class="swiper-box">
			<swiper circular="true" autoplay="true" @change="swiperChange">
				<swiper-item v-for="(swiper,index) in swiperList" :key="index">
					<image :src="imgsrc + swiper"></image>
				</swiper-item>
			</swiper>
			<view class="indicator">{{currentSwiper+1}}/{{swiperList.length}}</view>
		</view>
		<!-- 标题 价格 -->
		<view class="info-box goods-info">
			<view class="price-number">
				<view class="name">抢购价</view>
				<view class="price">
					<view>￥<span>{{sku.price}}</span></view>
					<view class="slogan">￥{{sku.original_price}}</view>
				</view>
				<view class="sold">{{goods.sale}}件已售</view>
			</view>
			<view class="info">
				<view class="title">
					<view class="name">
						{{goods.name}}
					</view>
					<view class="text">{{goods.detail_desc}}</view>
				</view>
				<view class="box" @tap="keep">
					<view class="icon">
						<image mode="widthFix" src="/static/img/goods/icon_shoucang1.png"></image>
					</view>
					<view class="text">收藏</view>
				</view>
			</view>
		</view>

		<!-- 服务-规则选择 -->
		<view class="info-box spec">
			<view class="row">
				<view class="text">优惠</view>
				<view class="content">全场商品抵用券</view>
				<view class="arrow">
					<view class="btn">抵用券</view>
				</view>
			</view>
			<view class="row">
				<view class="text">活动</view>
				<view class="content">暂无活动</view>
			</view>
			<view class="row">
				<view class="text">发货地</view>
				<view class="content">{{goods.area}}</view>
				<view class="text delivery">快递</view>
				<view class="content">0.00</view>
				<view class="arrow">
					<view class="text">月销售{{goods.sale}}+</view>
				</view>
			</view>
			<view class="row" @tap="showService">
				<view class="text">服务</view>
				<view class="content">
					<view class="serviceitem" v-for="(item,index) in goodsData.service" :key="index">{{item.name}}</view>
				</view>
				<view class="arrow">
					<view class="yticon icon-you"></view>
				</view>
			</view>
			<view class="row">
				<view class="text">库存</view>
				<view class="content">{{sku.qty}}</view>
			</view>
		</view>
		<!-- 评价 -->
		<view class="info-box comments" id="comments">
			<view class="row">
				<view class="text">商品评价({{goodsData.comment.number}})</view>
				<view class="arrow">
					好评率0%
				</view>
			</view>
			<view class="row" v-if="goodsData.comment.number == 0">
				<view class="title">———— 暂无评价 ————</view>
			</view>
			<view class="comment" v-else @tap="toRatings">
				<view class="user-info">
					<view class="face">
						<image :src="goodsData.comment.userface"></image>
					</view>
					<view class="arrow">
						<view class="name-rating">
							<view class="username">
								{{goodsData.comment.username}}
							</view>
							<view class="rating">
								好评率90%
							</view>
						</view>
						<view class="Star">
							<image src="/static/img/goods/doc_4.png" mode="" class="f01"></image>
							<image src="/static/img/goods/doc_4.png" mode="" class="f01"></image>
							<image src="/static/img/goods/doc_4.png" mode="" class="f01"></image>
							<image src="/static/img/goods/doc_4.png" mode="" class="f01"></image>
						</view>
					</view>
				</view>
				<view class="content_content">
					{{goodsData.comment.content}}
				</view>
				<view class="img-video">
					<view class="box" v-for="item in goodsData.comment.video" @tap="playVideo(item.path)" :key="item.path">
						<image mode="aspectFill" :src="item.img"></image>
						<view class="playbtn">
							<view class="icon bofang"></view>
						</view>
					</view>
					<view class="box" v-for="item in goodsData.comment.img" @tap="showBigImg(item,row.first.img)" :key="item">
						<image mode="aspectFill" :src="item"></image>
					</view>
				</view>
			</view>
			<view class="row2" v-if="goodsData.comment.number != 0">
				<view class="btn" @tap="toRatings">查看全部评价</view>
			</view>
		</view>
		<!-- 详情 -->
		<view class="description">
			<view class="title">———— 商品详情 ————</view>
			<view class="content">
				<rich-text :nodes="descriptionStr"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	import Api from '@/common/api';
	export default {
		data() {
			return {
				imgsrc: Api.imgsrc,
				product_id: '',
				goods: [],
				skuList: [],
				sku: [],
				specList: [],
				specSelected: [],
				specSelectedValue: '',
				//控制渐变标题栏的参数
				beforeHeaderzIndex: 11, //层级
				afterHeaderzIndex: 10, //层级
				beforeHeaderOpacity: 1, //不透明度
				afterHeaderOpacity: 0, //不透明度
				//是否显示返回按钮
				// #ifndef MP
				showBack: true,
				// #endif
				//轮播主图数据
				swiperList: [],
				//轮播图下标
				currentSwiper: 0,
				anchorlist: [], //导航条锚点
				selectAnchor: 0, //选中锚点
				serviceClass: '', //服务弹窗css类，控制开关动画
				specClass: '', //规格弹窗css类，控制开关动画
				shareClass: '', //分享弹窗css类，控制开关动画
				// 商品信息
				goodsData: {
					id: 1,
					name: "商品标题",
					price: "127.00",
					number: 1,
					service: [{
							name: "正品保证",
							description: "此商品官方保证为正品"
						},
						{
							name: "极速退款",
							description: "此商品享受退货极速退款服务"
						},
						{
							name: "7天退换",
							description: "此商品享受7天无理由退换服务"
						}
					],
					spec: ["XS", "S", "M", "L", "XL", "XXL"],
					comment: {
						number: 0,
						userface: '/static/img/face.jpg',
						date: '2019-04-21',
						spec: "规格: XL",
						grade: "good",
						username: '牧耘郎',
						content: '很不错，之前买了很多次了，值得购买！',
						img: ["https://ae01.alicdn.com/kf/HTB1wREwTXzqK1RjSZFvq6AB7VXaT.jpg",
							"https://ae01.alicdn.com/kf/HTB1sL7hTjDpK1RjSZFrq6y78VXaw.jpg",
						],
						video: [{
							img: "https://ae01.alicdn.com/kf/HTB1AMEBTcfpK1RjSZFOq6y6nFXaK.jpg",
							path: "https://mp4.vjshi.com/2018-12-28/1083f3db90334f86e3fc3586b4472914.mp4"
						}]

					}
				},
				selectSpec: null, //选中规格
				isKeep: false, //收藏
				//商品描述html
				descriptionStr: '',
				videoDirection: 0,
				showFullscreenBtn: true,
				showPlayBtn: true,
				isPlayVideo: true,
				videoSrc: '',
				cart_amount: 0, //购物车数量
				amount: 1, //数量
			};
		},
		async onLoad(option) {
			// #ifdef MP
			//小程序隐藏返回按钮
			this.showBack = false;
			// #endif
			//option为object类型，会序列化上个页面传递的参数
			this.product_id = option.product_id;
			if (this.product_id) {
				var parm_data = {
					'product_id': this.product_id
				}
				let cartList = uni.getStorageSync('cartList');
				let data = await Api.apiCall('post', Api.goods.goodsDetail, parm_data);
				if(data)
				{
					this.skuList = data.skuList;
					this.goods = data.good;	
					this.sku = this.skuList[0];
					if (cartList) {
						this.cart_amount = cartList.length;
					} else {
						this.cart_amount = data.total_count; //购物车商品数量
					}
					
					var price = this.sku.price;
					var ori_price = this.sku.original_price;
					this.sku.price = parseFloat(price).toFixed(2);
					this.sku.original_price = parseFloat(ori_price).toFixed(2);
					this.isKeep = 0;
					var subImages = this.sku.image;
					this.swiperList = subImages.split(',');
					let specList = data.specs;
					this.specSelected = this.sku.spec_value_ids.split(',');
					specList.forEach(item => {
						let spec_value = item.spec_value;
						if (spec_value) {
							for (let cItem of spec_value) {
								if (this.specSelected.indexOf(cItem.id.toString()) != -1) {
									cItem.selected = 1
									this.specSelectedValue = this.specSelectedValue + cItem.name + ",";
								} else {
									cItem.selected = 0
								}
							}
						}
					})
					this.specList = specList;
					this.specSelectedValue = this.specSelectedValue + (this.cart_amount >= 1 ? this.cart_amount : this.amount) + "件";
					var detail_img = this.goods.detail_html.split(',');
					var detail_html = '';
					for(var i = 0; i < detail_img.length; i++) {
						detail_html += '<img width="100%" src="' + Api.imgsrc + detail_img[i] + '"/>'
					}
					if(detail_html)
					{
						this.descriptionStr = '<div style="text-align:center;font-size:0;">' + detail_html + '</div>';
					}
				}
				
			}
		},
		onReady() {
			this.calcAnchor(); //计算锚点高度，页面数据是ajax加载时，请把此行放在数据渲染完成事件中执行以保证高度计算正确
		},
		onPageScroll(e) {
			//锚点切换
			this.selectAnchor = e.scrollTop >= this.anchorlist[2].top ? 2 : e.scrollTop >= this.anchorlist[1].top ? 1 : 0;
			//导航栏渐变
			let tmpY = 375;
			e.scrollTop = e.scrollTop > tmpY ? 375 : e.scrollTop;
			this.afterHeaderOpacity = e.scrollTop * (1 / tmpY);
			this.beforeHeaderOpacity = 1 - this.afterHeaderOpacity;
			//切换层级
			this.beforeHeaderzIndex = e.scrollTop > 0 ? 10 : 11;
			this.afterHeaderzIndex = e.scrollTop > 0 ? 11 : 10;
		},
		//上拉加载，需要自己在page.json文件中配置"onReachBottomDistance"
		onReachBottom() {
			uni.showToast({
				title: '触发上拉加载'
			});
		},
		mounted() {

		},
		computed: {
			...mapState(['hasLogin'])
		},
		methods: {
			//轮播图指示器
			swiperChange(event) {
				this.currentSwiper = event.detail.current;
			},
			//消息列表
			toMsg() {
				uni.navigateTo({
					url: '/pages/msg/msg'
				})
			},
			//收藏
			keep() {
				this.isKeep = this.isKeep ? false : true;
			},
			//商品评论
			toRatings() {
				uni.navigateTo({
					url: '/mall/product/ratings'
				})
			},
			//跳转评论列表
			showComments(goodsid) {

			},
			//选择规格
			setSelectSpec(index) {
				this.selectSpec = index;
			},
			//选择规格
			selectSpecMethod(index, childIndex, childItem) {
				let list = this.specList[index].spec_value;
				this.specSelectedValue = "";
				var indexCount = 0;
				list.forEach(item => {
					if (childItem.selected) {
						return false;
					}
					if (item.selected) {
						indexCount = this.specSelected.indexOf(item.id.toString());
					}
				})
				list.forEach(item => {
					if (item.id === childItem.id) {
						this.specSelected.splice(indexCount, 1, item.id.toString());
						this.$set(item, 'selected', 1);
					} else {
						this.$set(item, 'selected', 0);
					}
				})
				//选择商品SKU属性值更改商品对应的SKU;
				this.skuList.forEach(item => {
					var specSelected = item.spec_value_ids.split(',');
					if (specSelected.join(",") == this.specSelected.join(",")) {
						this.sku = item;
						var price = this.sku.price;
						var ori_price = this.sku.original_price;
						this.sku.price = parseFloat(price).toFixed(2);
						this.sku.original_price = parseFloat(ori_price).toFixed(2);
						this.swiperList = item.image.split(',');
					}
				})
				this.specList.forEach(item => {
					let spec_item_value = item.spec_value;
					for (let cItem of spec_item_value) {
						if (cItem.selected == 1) {
							this.specSelectedValue = this.specSelectedValue + cItem.name + ",";
						}
					}
				})
				this.specSelectedValue = this.specSelectedValue + this.amount + "件";
			},
			//减少数量
			sub() {
				if (this.amount <= 1) {
					return;
				}
				// this.cart_amount--;
				this.amount--;
				var list = this.specSelectedValue.split(',');
				list.splice(list.length - 1, 1, this.amount + '件')
				this.specSelectedValue = list.join(',');
			},
			//增加数量
			add() {
				// this.cart_amount++;
				this.amount++;
				var list = this.specSelectedValue.split(',');
				list.splice(list.length - 1, 1, this.amount + '件')
				this.specSelectedValue = list.join(',');

				console.log('添加购物车', JSON.stringify(this.specSelectedValue));
				this.$forceUpdate();
			},
			//跳转锚点
			toAnchor(index) {
				this.selectAnchor = index;
				uni.pageScrollTo({
					scrollTop: this.anchorlist[index].top,
					duration: 200
				});
			},
			//计算锚点高度
			calcAnchor() {
				this.anchorlist = [{
						name: '商品',
						top: 0
					},
					{
						name: '评价',
						top: 0
					},
					{
						name: '详情',
						top: 0
					}
				]
				let commentsView = uni.createSelectorQuery().select("#comments");
				commentsView.boundingClientRect((data) => {
					let statusbarHeight = 0;
					//APP内还要计算状态栏高度
					// #ifdef APP-PLUS
					statusbarHeight = plus.navigator.getStatusbarHeight()
					// #endif
					let headerHeight = uni.upx2px(100);
					this.anchorlist[1].top = data.top - headerHeight - statusbarHeight;
					this.anchorlist[2].top = data.bottom - headerHeight - statusbarHeight;

				}).exec();
			},
			//返回上一页
			back() {
				uni.navigateBack();
			},
			//服务弹窗
			showService() {
				this.serviceClass = 'show';
			},
			//关闭服务弹窗
			hideService() {
				this.serviceClass = 'hide';
				setTimeout(() => {
					this.serviceClass = 'none';
				}, 200);
			},
			specCallback() {
				return;
			},
			//关闭规格弹窗
			hideSpec() {
				this.specClass = 'hide';
				//回调
				this.selectSpec && this.specCallback && this.specCallback();
				this.specCallback = false;
				setTimeout(() => {
					this.specClass = 'none';
				}, 200);
			},
			discard() {
				var list = this.specSelectedValue.split(',');
				list.splice(list.length - 1, 1, this.amount + '件')
				this.specSelectedValue = list.join(',');
			},
			playVideo(path) {
				this.videoSrc = path;
				// this.isPlayVideo = true;
				this.$nextTick(function() {
					this.videoContext.requestFullScreen({
						direction: 0
					});
				});

			},
			stopPlayVideo() {
				this.videoContext.pause();
			},
		}
	};
</script>

<style lang="scss">
	page {
		background-color: #f8f8f8;
	}

	@keyframes showPopup {
		0% {
			opacity: 0;
		}

		100% {
			opacity: 1;
		}
	}

	@keyframes hidePopup {
		0% {
			opacity: 1;
		}

		100% {
			opacity: 0;
		}
	}

	@keyframes showLayer {
		0% {
			transform: translateY(0);
		}

		100% {
			transform: translateY(-100%);
		}
	}

	@keyframes hideLayer {
		0% {
			transform: translateY(-100%);
		}

		100% {
			transform: translateY(0);
		}
	}

	.yticon {
		font-size: 28upx;
		color: #232323;
	}

	.status {
		width: 100%;
		height: 0;
		position: fixed;
		z-index: 10;
		top: 0;
		/*  #ifdef  APP-PLUS  */
		height: var(--status-bar-height); //覆盖样式
		/*  #endif  */
		background-color: #f1f1f1;
		transition: opacity 0.05s linear;
	}

	.header {
		width: 100%;

		height: 100upx;
		display: flex;
		align-items: center;
		position: fixed;
		top: 0;
		z-index: 10;
		/*  #ifdef  APP-PLUS  */
		top: var(--status-bar-height);

		/*  #endif  */
		.before,
		.after {
			width: 100%;
			padding: 0 4%;
			height: 100upx;
			display: flex;
			align-items: center;
			position: fixed;
			top: 0;
			/*  #ifdef  APP-PLUS  */
			top: var(--status-bar-height);
			/*  #endif  */
			transition: opacity 0.05s linear;

			.back {
				width: 125upx;
				height: 60upx;
				flex-shrink: 0;

				.yticon {
					margin-left: -10%;
					width: 60upx;
					height: 60upx;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 54upx;
					color: #000000;
				}
			}

			.middle {
				width: 100%;

			}

			.icon-btn {
				width: 125upx;
				height: 60upx;
				flex-shrink: 0;
				display: flex;

				.yticon {
					&:first-child {
						margin-right: 5upx;
					}

					width: 60upx;
					height: 60upx;
					display: flex;
					justify-content: center;
					align-items: center;
					font-size: 42upx;
				}
			}
		}

		.before {
			.back {
				.yticon {
					color: #fff;
					background-color: rgba(0, 0, 0, 0.2);
					border-radius: 100%;
				}
			}

			.icon-btn {
				.yticon {
					color: #fff;
					background-color: rgba(0, 0, 0, 0.2);
					border-radius: 100%;

				}
			}
		}

		.after {
			background-color: #f1f1f1;

			.back {
				.yticon {
					color: #666;
				}
			}

			.icon-btn {
				.yticon {
					color: #666;
				}
			}

			.middle {
				font-size: 32upx;
				height: 100%;
				display: flex;
				justify-content: center;
				align-items: center;
				padding: 0 31upx;
				box-sizing: border-box;
			
				.middle_item {
					flex: 1;
					height: 100%;
					box-sizing: border-box;
					display: flex;
					justify-content: center;
					align-items: center;
					position: relative;
					color: #757677;
					&.on {
						color: #232323;
						&::before{
							content: '';
							position: absolute;
							bottom: 0;
							width: 50%;
							height: 6upx;
							background-color: #FFBC21;
						}
					}
				}
			}
		}
	}

	.swiper-box {
		position: relative;
		width: 100%;
		height: 100vw;

		swiper {
			width: 100%;
			height: 100vw;

			swiper-item {
				image {
					width: 100%;
					height: 100vw;
				}
			}
		}

		.indicator {
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 0 25upx;
			height: 40upx;
			border-radius: 40upx;
			font-size: 22upx;
			position: absolute;
			bottom: 20upx;
			right: 20upx;
			color: #fff;
			background-color: rgba(0, 0, 0, 0.2);
		}
	}

	.info-box {
		width: 100%;
		padding: 20upx 4%;
		background-color: #fff;
		margin-bottom: 20upx;
	}

	.goods-info {
		width: 100%;
		padding: 0;

		.price-number {
			align-items: center;
			height: 98upx;
			display: flex;
			background-color: #FFBC21;
			font-size: 24upx;
			color: #232323;

			.name {
				width: 142upx;
				height: 98upx;
				color: #FFFFFF;
				display: flex;
				align-items: center;
				justify-content: center;
				border-bottom-right-radius: 25px 60px;
				border-top-right-radius: 25px 60px;
				font-size: 28upx;
				background-color: #232323;
			}

			.price {
				width: 220upx;
				margin-left: 20upx;
				display: flex;
				justify-content: space-between;
				align-items: center;

				span {
					font-size: 56upx;
				}

				.slogan {
					margin-left: 30upx;
					text-decoration: line-through;
				}
			}

			.sold {
				width: 350upx;
				margin-right: 25upx;
				display: flex;
				justify-content: flex-end;
				// margin-right:20upx;
			}
		}

		.info {
			width: 92%;
			height: 128upx;
			margin: 0 4%;
			justify-content: space-between;
			display: flex;
			font-size: 24upx;
			color: #ABADAD;

			.title {
				margin: 15upx 0;

				.name {
					font-size: 36upx;
					margin-bottom: 10upx;
					color: #232323;
				}
			}

			.box {
				margin: 30upx 0;

				.icon {
					display: flex;
					justify-content: center;
					width: 40upx;
					height: 40upx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.text {
					display: flex;
					justify-content: center;
					width: 100%;
					font-size: 20upx;
					color: #ABADAD;
				}
			}

		}
	}

	.spec {
		.row {
			width: 100%;
			display: flex;
			align-items: center;
			margin: 0 0 30upx 0;

			.text {
				font-size: 28upx;
				color: #232323;
				margin-right: 20upx;
			}

			.delivery {
				font-size: 28upx;
				color: #232323;
				margin-left: 80upx;
			}

			.content {
				font-size: 28upx;
				display: flex;
				flex-wrap: wrap;

				.serviceitem {
					margin-right: 10upx;
				}

				.sp {
					width: 100%;
					display: flex;

					view {
						background-color: #f6f6f6;
						padding: 5upx 10upx;
						color: #999;
						margin-right: 10upx;
						font-size: 20upx;
						border-radius: 5upx;

						&.on {
							border: solid 1upx #f47952;
							padding: 4upx 8upx;
						}
					}
				}
			}

			.arrow {
				position: absolute;
				right: 4%;

				.text {
					font-size: 28upx;
					color: #232323;
					margin-right: 0upx;
				}

				.yticon {
					color: #ccc;
				}

				.btn {
					width: 120upx;
					height: 48upx;
					font-size: 24upx;
					display: flex;
					border: 2upx solid #E3E7E3;
					align-items: center;
					justify-content: center;
					border-radius: 10upx;
				}
			}
		}
	}

	.comments {
		.row {
			width: 100%;
			height: 40upx;
			display: flex;
			margin: 0 0 30upx 0;
			justify-content: space-between;

			.text {
				font-size: 28upx;
			}

			.arrow {
				font-size: 28upx;
				color: #232323;
			}
			.title {
				width: 100%;
				height: 80upx;
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: $font-base + 4upx;
				color: #999;
			}
		}

		.row2 {
			width: 100%;
			height: 88upx;
			display: flex;
			justify-content: center;

			.btn {
				width: 208upx;
				height: 58upx;
				display: flex;
				margin: 12upx 18upx 0;
				border-radius: 29upx;
				border: 2upx solid #E3E7E3;
				justify-content: center;
				align-items: center;
				font-size: 26upx;
				color: #313333;
			}
		}

		.comment {
			width: 100%;
			display: flex;
			flex-wrap: wrap;

			.user-info {
				width: 100%;
				height: 80upx;
				display: flex;
				align-items: center;

				.face {
					width: 66upx;
					height: 66upx;
					margin-right: 8upx;
					flex-shrink: 0;

					image {
						width: 66upx;
						height: 66upx;
						border-radius: 100%;
					}
				}

				.arrow {
					width: 100%;
					display: flex;
					flex-wrap: wrap;
					margin-left: 20upx;

					.name-rating {
						width: 100%;
						display: flex;
						justify-content: space-between;
						align-items: baseline;

						.username {
							font-size: 24upx;
							color: #313333;
						}

						.rating {
							font-size: 24upx;
							color: #232323;
						}
					}

					.Star {
						width: 100%;
						color: #aaa;
						font-size: 26upx;

						.f01 {
							width: 20upx;
							height: 19upx;
							margin-right: 2upx;
						}
					}

				}

				.username {
					font-size: 24upx;
					color: #999;
				}
			}

			.content_content {
				width: 100%;
				margin-top: 10upx;
				font-size: 26upx;
			}

			.img-video {
				width: 100%;
				display: flex;
				justify-content: space-between;

				.box {
					width: 208upx;
					height: 208upx;
					margin: 29upx 0 20upx;
					position: relative;
					align-items: center;

					image {
						position: absolute;
						width: 100%;
						height: 100%;
						border-radius: 10upx;
					}

					.playbtn {
						position: absolute;

						.icon {
							font-size: 80upx;
							color: rgba(255, 255, 255, .9)
						}
					}
				}
			}
		}
	}

	.description {
		.title {
			width: 100%;
			height: 80upx;
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 26upx;
			color: #999;
		}
		
	}

	.popup {
		position: fixed;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 20;
		display: none;

		.mask {
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: 21;
			background-color: rgba(0, 0, 0, 0.6);
		}

		.layer {
			position: fixed;
			z-index: 22;
			bottom: -70%;
			width: 100%;
			padding: 0 4%;
			height: 70%;
			border-radius: 20upx 20upx 0 0;
			background-color: #fff;
			display: flex;
			flex-wrap: wrap;
			align-content: space-between;

			.content {
				width: 100%;
				padding: 20upx 0;

				.row {
					width: 100%;
					display: flex;
					align-items: center;
					margin: 0 0 30upx 0;

					.text {
						font-size: 28upx;
						color: #232323;
						margin-right: 20upx;
					}

					.content_spc {
						font-size: 28upx;
						display: flex;
						margin-right: 10upx;
						flex-wrap: wrap;
						height: 60upx;
						padding: 0 20upx;
						align-items: center;
						border: 2upx solid #E3E7E3;
					}

					.selected {
						border: 2upx solid red;
					}
				}

			}

			.btn {
				width: 100%;
				height: 100upx;

				.button {
					width: 100%;
					height: 80upx;
					border-radius: 40upx;
					color: #fff;
					display: flex;
					align-items: center;
					justify-content: center;
					background-color: #f47952;
					// font-size: 28upx;
					font-size: $font-lg;
					color: #fff;
					background-color: #FFBC21;
					box-shadow: 1px 2px 5px rgba(255, 188, 33, 0.4);
				}
			}
		}

		&.show {
			display: block;

			.mask {
				animation: showPopup 0.2s linear both;
			}

			.layer {
				animation: showLayer 0.2s linear both;
			}
		}

		&.hide {
			display: block;

			.mask {
				animation: hidePopup 0.2s linear both;
			}

			.layer {
				animation: hideLayer 0.2s linear both;
			}
		}

		&.none {
			display: none;
		}

		&.service {
			.row {
				margin: 30upx 0;

				.title {
					font-size: 30upx;
					margin: 10upx 0;
				}

				.description {
					font-size: 28upx;
					color: #999;
				}
			}
		}

		&.spec {
			.title {
				font-size: 30upx;
				margin: 30upx 0;
			}

			.sp {
				display: flex;

				view {
					font-size: 28upx;
					padding: 5upx 20upx;
					border-radius: 8upx;
					margin: 0 30upx 20upx 0;
					background-color: #f6f6f6;

					&.on {
						padding: 3upx 18upx;
						border: solid 1upx #f47925;
					}
				}
			}

			.length {
				margin-top: 30upx;
				border-top: solid 1upx #aaa;
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-top: 20upx;

				.text {
					font-size: 30upx;
				}

				.number {
					display: flex;
					justify-content: center;
					align-items: center;

					.input {
						width: 80upx;
						height: 60upx;
						margin: 0 10upx;
						background-color: #f3f3f3;
						display: flex;
						justify-content: center;
						align-items: center;
						text-align: center;

						input {
							width: 80upx;
							height: 60upx;
							display: flex;
							justify-content: center;
							align-items: center;
							text-align: center;
							font-size: 26upx;
						}
					}

					.sub,
					.add {
						width: 60upx;
						height: 60upx;
						background-color: #f3f3f3;
						border-radius: 5upx;

						.yticon {
							font-size: 30upx;
							width: 60upx;
							height: 60upx;
							display: flex;
							justify-content: center;
							align-items: center;

						}
					}
				}
			}

		}
	}

</style>
